<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../media-resources/media-file.js"></script>
<video crossorigin></video>
<canvas></canvas>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    var mediaFile = "../../media/resources/test.ogv";
    var type = mimeTypeForExtension(mediaFile.split('.').pop());

    video.onerror = t.unreached_func();
    video.onplaying = t.step_func_done(function() {
        var ctx = document.querySelector("canvas").getContext("2d");
        ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
        ctx.getImageData(0, 0, video.videoWidth, video.videoHeight);
    });

    video.src = "http://localhost:8080/security/resources/video-cross-origin-allow.php?name=" + mediaFile + "&type=" + type;
    video.play();
});
</script>